﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace MyChart
{
    /// <summary>
    /// 表示图表中的目标线
    /// </summary>
    public class TargetLine
    {
        #region 字段

        private decimal _startValue = 0;
        private decimal _endValue = 0;
        private bool _enableEndValue = false;
        private Color _color = new Color();
        private string _text = "";
        private int _borderWidth = 2;
        private bool _isDashed = true;
        private bool _textLeftAlign = false;

        #endregion

        #region 属性

        /// <summary>
        /// 获取或设置目标线的起始值
        /// </summary>
        public decimal StartValue
        {
            get { return _startValue; }
            set { _startValue = value; }
        }

        /// <summary>
        /// 获取或设置目标线的结束值
        /// </summary>
        public decimal EndValue
        {
            get { return _endValue; }
            set
            {
                _endValue = value;
                _enableEndValue = true;
            }
        }

        /// <summary>
        /// 获取或设置一个值，表示是否启用目标线结束值（为true时，结束值是不其作用的，目标线为一条水平线）
        /// </summary>
        public bool EnableEndValue
        {
            get { return _enableEndValue; }
            set { _enableEndValue = value; }
        }

        /// <summary>
        /// 获取或设置目标线的颜色
        /// </summary>
        public Color Color
        {
            get { return _color; }
            set { _color = value; }
        }

        /// <summary>
        /// 获取或设置目标线的文本标签
        /// </summary>
        public string Text
        {
            get { return _text; }
            set { _text = value; }
        }

        /// <summary>
        /// 获取或设置目标线的厚度
        /// </summary>
        public int BorderWidth
        {
            get { return _borderWidth; }
            set { _borderWidth = value; }
        }

        /// <summary>
        /// 获取或设置一个值，表示目标线是否以虚线形式展现
        /// </summary>
        public bool IsDashed
        {
            get { return _isDashed; }
            set { _isDashed = value; }
        }

        /// <summary>
        /// 获取或设置一个值，表示文本标签是否靠左显示
        /// </summary>
        public bool TextLeftAlign
        {
            get { return _textLeftAlign; }
            set { _textLeftAlign = value; }
        }

        #endregion
    }
}
